<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset('utf-8'); ?>
	<title>
        <?php echo __('Tales Of Deonia')?>
	</title>
	<?php
    //echo $this->Html->meta('icon');
    echo $this->Html->css(array('cake.generic', 'tales', 'jquery-ui-1.10.3', 'jquery-ui-timepicker-addon'));
    echo $this->Html->script(array('jquery-1.10.2.min', 'jquery-ui-1.10.3', 'jquery-ui-timepicker-addon'));

    //echo $this->fetch('meta');
    echo $this->fetch('css');
    echo $this->fetch('script');

	?>
</head>
<body>
	<div id="container">
		<div id="header">
            <div style="float: left;padding-top: 5px;">
                | <?php echo $this->Html->link(__('USER SEARCH'), array('controller' => 'User', 'action' => 'user_list'));?> |
                <?php if(CakeSession::check('tbl_auth')) {?>
                    | <?php echo $this->Html->link(__('STATS'), array('controller' => 'Stats', 'action' => 'stats_user'));?> |
                    | <?php echo $this->Html->link(__('ETC'), array('controller' => 'Etc', 'action' => 'system_setting'));?> |
                <?php }?>
            </div>
            <div style="float: left;">
                <?php if(!empty($login_err_msg)) {?>
                    <div class="error_message" style="width: 150px;margin-left: 100px;margin-top: 3px"><?php echo $login_err_msg?></div>
                <?php }?>
                <?php if(!empty($login_msg)) {?>
                    <div class="success_message" style="width: 150px;margin-left: 100px;margin-top: 3px"><?php echo $login_msg?></div>
                <?php }?>
            </div>
            <?php if(!CakeSession::check('tbl_auth')) {?>
                <div style="width: 360px;float: right;">
                    <div><?php echo $this->Form->create('tbl_auth')?></div>
                    <div style="width: 20px;float: left;padding-top: 5px">
                        <?php echo __(LANG_ADMIN_ID)?>
                    </div>
                    <div class="id_input" style="width: 100px;float: left;">
                        <?php echo $this->Form->input('admin_id', array(
                            'label' => false,
                            'type' => 'text',
                        ));?>
                    </div>
                    <div style="width: 40px;float: left;padding-left: 25px;padding-top: 5px">
                        <?php echo __(LANG_ADMIN_PASS)?>
                    </div>
                    <div class="pass_input" style="width: 100px;float: left;">
                        <?php echo $this->Form->input('admin_pass', array(
                            'label' => false,
                            'type' => 'password',
                        ));?>
                    </div>
                    <div style="width: 50px;float: right">
                        <?php echo $this->Form->end(__(LANG_LOGIN))?>
                    </div>
                </div>
            <?php } else {?>
                <div style="float: right;padding-top: 5px;">
                    <?php echo __(LANG_WELCOMTO)?> <?php echo CakeSession::read('tbl_auth.admin_name');?>.
                    <?php echo $this->Html->link(' ' . __(LANG_LOGOUT), array(
                            'out' => 'logout',
                            'id' => empty($this->passedArgs['id'])?'':$this->passedArgs['id'],
                            'search_value' => empty($this->passedArgs['search_value'])?'':$this->passedArgs['search_value'],
                            'char_serial' => empty($this->passedArgs['char_serial'])?'':$this->passedArgs['char_serial'],
                        )); ?>
                </div>
            <?php }?>
		</div>
		<div id="content">
			<?php echo $this->Session->flash(); ?>
			<?php echo $this->fetch('content'); ?>
        </div>
        <div id="footer">
        </div>
    </div>
    <?php echo $this->element('sql_dump'); ?>
</body>
</html>
